def strStr(haystack, needle):
    if not needle:
        return 0
    len_need = len(needle)
    i = 0
    while i < len(haystack):
        if haystack[i:len_need + i] == needle:
            return i
        i += 1
    return -1


print(strStr('hello', 'll'))  # 2
print(strStr('aaaaaa', 'bba'))  # -1
print(strStr('', ''))  # 0
